1import type { Metadata } from "next";2import { notFound } from "next/navigation";3import { apiServer } from "@/lib/api-server";4import type { GameInfo } from "@spinza/shared";5import type { ClientDefinition } from "@/components/game/types";6import { GameClient } from "@/components/game/game-client";78type Params = { params: Promise<{ slug: string }> };910export async function generateMetadata({ params }: Params): Promise<Metadata> {11 const { slug } = await params;12 const data = await apiServer<{ game: GameInfo }>(`/api/games/${slug}`);13 if (!data) return { title: "Game not found" };14 return { title: `${data.game.name} — play free`, description: data.game.description, robots: { index: false } };15}1617export default async function GamePage({ params }: Params) {18 const { slug } = await params;19 const data = await apiServer<{ game: GameInfo; definition: ClientDefinition }>(`/api/games/${slug}`);20 if (!data) notFound();21 return <GameClient game={data.game} definition={data.definition} />;22}23